package cn.tk.repository.mr;

import cn.tk.model.entity.mr.GlobalReply;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by denglw on 2021/8/13.<br/>
 * Desc: 全局回复dao
 */
@Repository("mrGlobalReplyDao")
public interface GlobalReplyDao extends JpaRepository<GlobalReply, Long> {

    /**
     * 获取bot的全局回复列表.<br/>
     * @param botId bot id
     * @return 全局回复列表
     */
    @Query(value = "select * from mr_bot_global_reply where bot_id=?1", nativeQuery = true)
    List<GlobalReply> findByBotId(Long botId);

}
